{% load i18n staticfiles section_list global_settings %}
{% global_settings %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>{% block title %}DCRM{% endblock %}</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>
    <meta name="renderer" content="webkit"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="robots" content="index, follow"/>
    <meta name="title" content="{{ settings.active_release.label }}"/>
    <meta name="description" content="{{ settings.active_release.description }}"/>
    <meta name="keywords" content="{{ settings.active_release.keywords }}"/>
    <meta name="generator" content="DCRM"/>
    <meta name="template" content="DefaultStyle"/>
    {% if settings.favicon_link %}
        <link rel="shortcut icon" href="{{ settings.favicon_link }}"/>
    {% endif %}
    {% block stylesheet %}
        <link rel="stylesheet" href="{% static "css/style.css" %}">
        <link rel="stylesheet" href="{% static "css/font.css" %}">
        <link rel="stylesheet" href="{% static "css/font-awesome.min.css" %}">
    {% endblock %}
    {% block headerscript %}
        <!-- Jquery and Main JS -->
        <script type="text/javascript" src="{% static "js/jquery.min.js" %}"></script>
        <script type="text/javascript" src="{% static "js/main.js" %}"></script>
        <script type="text/javascript" src="{% static "js/masonry.pkgd.min.js" %}"></script>
        <script type="text/javascript" src="{% static "js/fastclick.js" %}"></script>
    {% endblock %}
</head>
<body class="main">
<div class="header">
    <div class="nav">
        <div class="title">
            <h1><a href="{% url 'index' %}">DCRM</a></h1>
        </div>
        <div class="links">
            <ul>
                <li><a href="{% url 'index' %}">{% trans 'Home' %}</a></li>
                <li><a href="{% url 'section_list' %}">{% trans 'Section List' %}</a></li>
                <li><a href="{% url 'chart' %}">{% trans 'Chart' %}</a></li>
            </ul>
        </div>
        {% block search %}
            <div class="search">
                <form id="search-form" method="post" action="{% url 'search' %}">{% csrf_token %}
                    <input class="search-input" name="package"
                           placeholder="{% trans "Search packages" %}" autofocus/>
                    <div class="fa fa-search search-btn"></div>
                </form>
            </div>
        {% endblock %}
    </div>
    <div class="clear"></div>
</div>
<div class="container">
    <div class="widget-area">
        <div class="repo-card">
            <div class="avatar-panel">
                <div class="repo_pic">
                    {% if settings.active_release.icon_link %}
                        <img src="{{ settings.active_release.icon_link }}" alt="CydiaIcon"/>
                    {% else %}
                        <img src="{% static 'img/CydiaIcon.png' %}" alt="CydiaIcon">
                    {% endif %}
                </div>
                <div class="repo_name">
                    {% if settings.active_release %}
                        <h2>{{ settings.active_release.origin | default:_("Untitled Origin") }}</h2>
                        <p>{{ settings.active_release.description | default:_("No description.") }}</p>
                    {% else %}
                        <h2>{% trans "No repository created." %}</h2>
                        <p>{% trans "No repository description." %}</p>
                    {% endif %}
                </div>
            </div>
        </div>
        {% block notice %}
            {% if settings.notice %}
                <div class="notice">
                    <h2>{% trans "Notice" %}</h2>
                    <div class="notice-content">
                        {% autoescape off %}
                            {{ settings.notice }}
                        {% endautoescape %}
                    </div>
                </div>
            {% endif %}
        {% endblock %}
        {% section_list %}
        {% block section_list %}
            <div class="section_list">
                <h2>{% trans "Section List" %}</h2>
                <div class="list">
                    <ul>
                        {% for section in section_list %}
                            <li>
                                <div class="icon">
                                    {% if section.icon %}
                                        <img src="{{ section.icon_link }}" alt="Section Icon"/>
                                    {% else %}
                                        <img src="{% static 'img/default-package-icon.png' %}" alt="Section Icon"/>
                                    {% endif %}
                                    <span class="title"><a
                                            href="{% url "section_id" section.id %}">{{ section.name }}</a></span>
                                </div>
                            </li>
                        {% endfor %}
                    </ul>
                    {% if section_num > 8 %}
                        <div class="section_more"><a href="{% url 'section_list' %}">{% trans 'More...' %}</a></div>
                    {% endif %}
                </div>
            </div>
        {% endblock %}
        {% include 'social.html' %}
        {% block ad %}
            {% if settings.advertisement %}
                <div class="advertisement">
                    {% autoescape off %}
                        {{ settings.advertisement }}
                    {% endautoescape %}
                </div>
            {% endif %}
        {% endblock %}
    </div>
    <div class="content">
        <div class="breadcrumbs">
            <p>{% block breadcrumbs %}{% endblock %}</p>
        </div>
        {% block content %}{% endblock %}
    </div>
    <div class="clear"></div>
</div>
{% block footer %}
    <div class="footer">
        <ul>
            <li>
                &copy;
                {% if settings.copyright_name %}
                    {{ settings.copyright_name }}
                {% else %}
                    {{ settings.active_release.origin }}
                {% endif %}
                {% if settings.copyright_year %}
                    {{ settings.copyright_year }} - {% now "Y" %}
                {% else %}
                    {% now "Y" %}
                {% endif %}
                {% if settings.footer_icp %}
                    · {{ settings.footer_icp }}
                {% endif %}
            </li>
            <li>
                <span>·</span><a target="_blank" href="https://github.com/82Flex/DCRM">{% trans "Powered By DCRM" %}</a>
            </li>
            <li>
                <span>/</span><a target="_blank" href="{% url "admin:index" %}">{% trans "Django Admin" %}</a>
            </li>
        </ul>
        <div class="clear"></div>
    </div>
{% endblock %}
{% block footerscript %}{% endblock %}
{% block statistics %}
    {% if settings.external_statistics %}
        <div class="external_statistics">
            {% autoescape off %}
                {{ settings.external_statistics }}
            {% endautoescape %}
        </div>
    {% endif %}
{% endblock %}
</body>
{% if rtl_support %}
    <!-- RTL Support -->
    <style type="text/css">
    * {
        direction: rtl;
    }
    .container .content .article .description h2 {
        float: right;
    }
    .container .content .article .download {
        float: left;
    }
    .container .content .article .intro .details {
        float: right;
    }
    .emoji-menu {
        left: 0;
        right: initial;
    }
    .emoji-picker-icon {
        left: 10px;
        right: initial;
    }
    </style>
{% endif %}
</html>

